package com.lxq;

import java.util.ServiceLoader;

/**
 * @author 龙小虬
 * @date 2021/4/12 11:33
 */
public class Main01 {
    public static void main(String[] args) {
        Thread.currentThread().setContextClassLoader(Thread.currentThread().getContextClassLoader().getParent().getParent());
        System.out.println(Thread.currentThread().getContextClassLoader());
        ServiceLoader<SpiService> load = ServiceLoader.load(SpiService.class);
        load.forEach((k)->{
            System.out.println(k);
        });
    }
}
